package com.jr.Service.Impl;

import com.jr.Dao.ICouriersDao;
import com.jr.Dao.Impl.CouriersDaoImpl;
import com.jr.Pojo.Couriers;
import com.jr.Pojo.Packages;
import com.jr.Service.ICouriersService;
import com.jr.util.PageHelper;

import java.util.ArrayList;
import java.util.Date;

public class CouriersServiceImpl implements ICouriersService {
    ICouriersDao icd = new CouriersDaoImpl();

    @Override
    public int queryDataCount() {
        return icd.selectDataCount();
    }

    @Override
    public ArrayList<Couriers> queryAll(PageHelper ph) {
        return icd.selectAll(ph);
    }

    @Override
    public boolean addCouriers(String name,String phone) {
        return icd.insertCouriers(name,phone)>0;
    }

    @Override
    public boolean updateCouriers(Couriers couriers) {
        return icd.updateCouriers(couriers)>0;
    }

    @Override
    public boolean delCouriers(Integer id) {
        return icd.delCouriers(id)>0;
    }

    @Override
    public ArrayList<Couriers> queryByName(String name) {
        return icd.selectByName(name);
    }

    @Override
    public boolean updateCurrent_packages(Packages packages) {
        return icd.updateCurrent_packages(packages)>0;
    }

    @Override
    public int selectIdById(String id) {
        return icd.selectIdById(id);
    }

    @Override
    public int selectCountCurrentByStatus(Integer id){
        return icd.selectCountCurrentByStatus(id);
    }

    @Override
    public int selectCountCompleteByStatus(Integer id) {
        return icd.selectCountCompleteByStatus(id);
    }

    @Override
    public boolean updateByName(Couriers couriers) {
        return icd.updateByName(couriers)>0;
    }

    @Override
    public ArrayList<Couriers> queryAllDESC(PageHelper ph) {
        return icd.selectAllDESC(ph);
    }

    @Override
    public int selectAllDataCount(Integer courier_id) {
        return icd.selectAllDataCount(courier_id);
    }

    @Override
    public ArrayList<Packages> selectAll(Integer courier_id, PageHelper ph) {
        return icd.selectAll(courier_id,ph);
    }
}
